In [ ]:
# Import pandas and numpy
import pandas as pd
import numpy as np
# Import the classifiers we will be using
from sklearn.naive_bayes import GaussianNB
from sklearn.neighbors import KNeighborsClassifier
from sklearn.tree import DecisionTreeClassifier
from sklearn.ensemble import RandomForestClassifier
# Import train/test split function
from sklearn.model_selection import train_test_split
# Import cross validation scorer
from sklearn.model_selection import cross_val_score
# Import ROC AUC scoring function
from sklearn.metrics import roc_auc_score
In [ ]:
# Read in our dataset, using the parameter 'index_col' to select the index
In [ ]:
# Let's see the header
In [ ]:
# And the shape
In [ ]:
# Assign the features and the target
In [ ]:
# Create the train/test split
In [ ]:
# Choose the Decision Tree model
# Fit the model
# Make the predictions
# Score the predictions
# Print the score
In [ ]:
# Choose the K-Neareast Neighbors model
# Fit the model
# Make the predictions
# Score the predictions
# Print the score
In [ ]:
# Choose the Naive Bayes model
# Fit the model
# Make the predictions
# Score the predictions
# Print the score
In [ ]:
# Choose the Random Forest model
# Fit the model
# Make the predictions
# Score the predictions
# Print the score
In [ ]:
# Choose the Decision Tree model
# Fit, predict and score in one step, using cross_val_score()
# Print the scores
# Print the mean score
In [ ]:
# Choose the K-Neareast Neighbors model
# Fit, predict and score in one step, using cross_val_score()
# Print the scores
# Print the mean score
In [ ]:
# Choose the Naive Bayes model
# Fit, predict and score in one step, using cross_val_score()
# Print the scores
# Print the mean score
In [ ]:
# Choose the Random Forest model
# Fit, predict and score in one step, using cross_val_score()
# Print the scores
# Print the mean score
In [ ]: